/*
 * Copyright (C) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "napi/native_api.h"
#include "../../comm/napi/util/napi_common.h"

#ifdef __cplusplus
extern "C" {
#endif

//JNIEXPORT jlong JNICALL Java_com_ohos_mars_xlog_Xlog_newXlogInstance(JNIEnv *env, jobject, jobject _log_config)
napi_value JS_com_ohos_mars_xlog_Xlog_newXlogInstance(napi_env env, napi_callback_info info);

//JNIEXPORT jlong JNICALL Java_com_ohos_mars_xlog_Xlog_getXlogInstance(JNIEnv *env, jobject, jstring _nameprefix)
napi_value JS_com_ohos_mars_xlog_Xlog_getXlogInstance(napi_env env, napi_callback_info info);

//JNIEXPORT void JNICALL Java_com_ohos_mars_xlog_Xlog_releaseXlogInstance(JNIEnv *env, jobject, jstring _nameprefix)
napi_value JS_com_ohos_mars_xlog_Xlog_releaseXlogInstance(napi_env env, napi_callback_info info);

//JNIEXPORT void JNICALL Java_com_ohos_mars_xlog_Xlog_appenderOpen(JNIEnv *env, jclass clazz, jobject _log_config)
napi_value JS_com_tenScent_mars_xlog_Xlog_appenderOpen(napi_env env, napi_callback_info info);

//JNIEXPORT void JNICALL Java_com_ohos_mars_xlog_Xlog_appenderClose(JNIEnv *env, jobject)
napi_value JS_com_ohos_mars_xlog_Xlog_appenderClose(napi_env env, napi_callback_info info);

//JNIEXPORT void JNICALL Java_com_ohos_mars_xlog_Xlog_appenderFlush(JNIEnv *env, jobject, jlong _log_instance_ptr, jboolean _is_sync)
napi_value JS_com_ohos_mars_xlog_Xlog_appenderFlush(napi_env env, napi_callback_info info);


//JNIEXPORT void JNICALL Java_com_ohos_mars_xlog_Xlog_logWrite(JNIEnv *env, jclass, jobject _log_info, jstring _log)
napi_value JS_com_ohos_mars_xlog_Xlog_logWrite(napi_env env, napi_callback_info info);

//JNIEXPORT void JNICALL Java_com_ohos_mars_xlog_Xlog_logWrite2(JNIEnv *env, jclass, jlong _log_instance_ptr, int _level, jstring _tag, jstring _filename,
 //         jstring _funcname, jint _line, jint _pid, jlong _tid, jlong _maintid, jstring _log)
napi_value JS_com_ohos_mars_xlog_Xlog_logWrite2(napi_env env, napi_callback_info info);

//JNIEXPORT jint JNICALL Java_com_ohos_mars_xlog_Xlog_getLogLevel(JNIEnv *, jobject, jlong _log_instance_ptr)
napi_value JS_com_ohos_mars_xlog_Xlog_getLogLevel(napi_env env, napi_callback_info info);

//JNIEXPORT void JNICALL Java_com_ohos_mars_xlog_Xlog_setLogLevel(JNIEnv *, jobject, jlong _log_instance_ptr, jint _log_level)
napi_value JS_com_ohos_mars_xlog_Xlog_setLogLevel(napi_env env, napi_callback_info info);

//JNIEXPORT void JNICALL Java_com_ohos_mars_xlog_Xlog_setAppenderMode(JNIEnv *, jobject, jlong _log_instance_ptr, jint _mode)
napi_value JS_com_ohos_mars_xlog_Xlog_setAppenderMode(napi_env env, napi_callback_info info);

//JNIEXPORT void JNICALL Java_com_ohos_mars_xlog_Xlog_setConsoleLogOpen(JNIEnv *env, jobject, jlong _log_instance_ptr, jboolean _is_open)
napi_value JS_com_ohos_mars_xlog_Xlog_setConsoleLogOpen(napi_env env, napi_callback_info info);

//JNIEXPORT void JNICALL Java_com_ohos_mars_xlog_Xlog_setMaxFileSize(JNIEnv *env, jobject, jlong _log_instance_ptr, jlong _max_size)
napi_value JS_com_ohos_mars_xlog_Xlog_setMaxFileSize(napi_env env, napi_callback_info info);

//JNIEXPORT void JNICALL Java_com_ohos_mars_xlog_Xlog_setMaxAliveTime(JNIEnv *env, jobject, jlong _log_instance_ptr, jlong _max_time)
napi_value JS_com_ohos_mars_xlog_Xlog_setMaxAliveTime(napi_env env, napi_callback_info info);

#ifdef __cplusplus
}
#endif